SC.UserDefaults: Easy preferences using client-side storage

written by admin

One of the cool things about the release of FireFox 3.5 and IE8 is that all the major web browsers now support the HTML5 standard for client-side storage using localStorage.

SproutCore was designed from the beginning to yield apps that are offline-capable.  Given the widespread availability of this localStorage now, it’s time to start focusing offline mode to the framework.

About a year ago we added the SC.UserDefaults to provide easy client-side user preferences in SproutCore apps.  Now we just pushed live some fixes that make the code work on all modern browsers along with some new demo code to show you how it works.

Working with SC.UserDefaults is incredibly easy.  You just create an instance and then use get() and set() to read/write preference values; just like any other SproutCore object.  Setting properties will automatically save them to local storage.  The object is also bindings aware so you can easily bind to preferences from the other parts of your app.  In fact, this is how most of the demo application works.

In addition to simply reading/writing preferences to local storage, SC.UserDefaults also allows you to set a default appDomain and userDomain for these keys so that you can save preferences for different apps and users.  It also has a facility for you to load in a default set of preferences which will be returned if no override has been saved on the local browser.

MORE INFO

If you want to use SC.UserDefaults in your own app, there is a lot of info available for you now thanks to the hard work of so many team members.

Now Available - SproutCore 1.0 Reference Docs

written by admin

Link: Now Available - SproutCore 1.0 Reference Docs

Thanks to the hard work of Nick Crohn a draft version of the SproutCore Reference docs are now available at http://docs.sproutcore.com!

Note that these are draft docs generated automatically from the documentation source.  They have not been fully reviewed for accuracy or completeness, so expect to find bugs here and there.  But its a great start!

Introducing sc-doc

These docs are generated automatically using the doctool (based on jsdoc-toolkit) bundled with the SproutCore build tools.  Nick has made it really easy to use this doctool for SproutCore or even for your own app.

In your SproutCore project just type:

sc-doc your_app_name

To generate docs for your app.  To generate docs for SproutCore use:

sc-doc sproutcore/desktop

All documentation is placed into tmp/docs inside your project.

Chipping In

Thanks again to Nick for all of his hard work on this project!   There are a lot of other cool features coming in this area, but simply having the reference docs online in a Google-friendly way is a huge step forward.

If your interested in tracking the progress with the documentation project for SproutCore - code-named Dogfish - (or even pitching in to help), you can find more information on the Dogfish Wiki Page.

Sproutcasts

written by admin

Link: Sproutcasts

Talk about cross-promotion:  If you haven’t seen it already, the Geoffrey’s Sproutcasts series now has an official place on the SproutCore website at screencasts.sproutcore.com.  The RSS feed is the same since we’ll be cross posting.